<ul class="nav nav-tabs nav-stacked">
    <?php if (in_array('test/question/index', $path)) { ?>
        <li <?php if ($_SERVER['REQUEST_URI'] == '/test/question/index') echo 'class="on"' ?>><a
                href="/test/question/index">题目管理</a>
        </li>
    <?php } ?>

    <?php if (in_array('test/result/index', $path)) { ?>
        <li <?php if ($_SERVER['REQUEST_URI'] == '/test/result/index') echo 'class="on"' ?>><a
                href="/test/result/index">测评结果</a>
        </li>
    <?php } ?>

</ul>
<style>
    .on {
        background: #DEDADA;
    }
</style>
